﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Media;

namespace PTExpress.Templates
{
    public class MasterControl:Control
    {
        static MasterControl()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(MasterControl), new FrameworkPropertyMetadata(typeof(MasterControl)));
        }

        public static readonly DependencyProperty TitleProperty =
            DependencyProperty.Register("Title", typeof(object),
            typeof(MasterControl),
            new UIPropertyMetadata());

        // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty ImageSourceProperty =
            DependencyProperty.Register("ImageSource", typeof(object),
            typeof(MasterControl),
            new UIPropertyMetadata());

        public static readonly DependencyProperty ToolBarProperty =
            DependencyProperty.Register("ToolBar", typeof(object),
            typeof(MasterControl),
            new UIPropertyMetadata());

        public static readonly DependencyProperty MessageBarProperty =
            DependencyProperty.Register("MessageBar", typeof(object),
            typeof(MasterControl),
            new UIPropertyMetadata());

        public static readonly DependencyProperty ContentProperty =
            DependencyProperty.Register("Content", typeof(object),
            typeof(MasterControl),
            new UIPropertyMetadata());

        public static readonly DependencyProperty FooterProperty =
            DependencyProperty.Register("Footer", typeof(object),
            typeof(MasterControl),
            new UIPropertyMetadata());

        /// <summary>
        /// Gets or sets the title.
        /// </summary>
        /// <value>The title.</value>
        public object Title
        {
            get { return GetValue(TitleProperty); }
            set { SetValue(TitleProperty, value); }
        }

        /// <summary>
        /// Gets or sets the ImageSource.
        /// </summary>
        /// <value>The ImageSource.</value>
        /// 
        public object ImageSource
        {
            get { return GetValue(ImageSourceProperty); }
            set { SetValue(ImageSourceProperty, value); }
        }

        /// <summary>
        /// Gets or sets the ImageSource.
        /// </summary>
        /// <value>The ToolBar.</value>
        /// 
        public object ToolBar
        {
            get { return GetValue(ToolBarProperty); }
            set { SetValue(ToolBarProperty, value); }
        }
        /// <summary>
        /// Gets or sets the MessageBar.
        /// </summary>
        /// <value>The message bar.</value>
        public object MessageBar
        {
            get { return GetValue(MessageBarProperty); }
            set { SetValue(MessageBarProperty, value); }
        }

        /// <summary>
        /// Gets or sets the content.
        /// </summary>
        /// <value>The content.</value>
        public object Content
        {
            get { return GetValue(ContentProperty); }
            set { SetValue(ContentProperty, value); }
        }

        /// <summary>
        /// Gets or sets the footer.
        /// </summary>
        /// <value>The footer.</value>
        public object Footer
        {
            get { return GetValue(FooterProperty); }
            set { SetValue(FooterProperty, value); }
        }



        public ImageSource imageSource
        {
            get { return (ImageSource)GetValue(imageSourceProperty); }
            set { SetValue(imageSourceProperty, value); }
        }

        // Using a DependencyProperty as the backing store for imageSource.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty imageSourceProperty =
            DependencyProperty.Register("imageSource", typeof(ImageSource), typeof(MasterControl), new UIPropertyMetadata(null));


        public double FooterHeight
        {
            get { return (double)GetValue(FooterHeightProperty); }
            set { SetValue(FooterHeightProperty, value); }
        }

        // Using a DependencyProperty as the backing store for FooterHeight.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty FooterHeightProperty =
            DependencyProperty.Register("FooterHeight", typeof(double), typeof(MasterControl), new UIPropertyMetadata(null));
        /*
        public void SetTitle(Command cm, string Title)
        {
            this.Title = "";
            string M_LAN = SysLib.LanguageLib.GetLanguage();
            switch (cm)
            {
                case Command.New: this.Title = M_LAN.Equals("V") ? "THÊM " : "ADD ";
                    break;
                case Command.Edit: this.Title = M_LAN.Equals("V") ? "SỬA " : "EDIT ";
                    break;
            }
            this.Title += Title;
        }
         * */
    }
}
